import Vue from 'vue'

import router from './router'
import App from './App.vue'
import store from './store'
import Antd, { DatePicker, message } from 'ant-design-vue'
import rem from './utils/rem'
import base from './utils/index'

import 'ant-design-vue/dist/antd.less'
import './assets/cover.less'
import './assets/common.less'
import './styles/common.scss'
import '@/utils/filter'
import { VueAxios } from '@/utils/request'
import Storage from 'vue-ls'
import '@/permission'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './styles/element-variables.scss'
import '@/assets/iconfont/iconfont.css'
import { $get, $post } from '@/api/request'
import ECharts from 'vue-echarts' // 在 webpack 环境下指向 components/ECharts.vue

import directive from './directive'

import './filters'
import { AccPage, AccTable, AccDesensitization } from './components/common/index' // directive

DatePicker.props.getCalendarContainer.default = child => child.parentNode
DatePicker.MonthPicker.props.getCalendarContainer.default = child => child.parentNode
DatePicker.RangePicker.props.getCalendarContainer.default = child => child.parentNode
DatePicker.WeekPicker.props.getCalendarContainer.default = child => child.parentNode

Vue.config.productionTip = false
Vue.use(directive)
Vue.use(AccPage)
Vue.use(AccTable)
Vue.use(AccDesensitization)
Vue.use(Antd)
Vue.use(ElementUI)
Vue.use(Storage, {
  namespace: 'Standard__', // key prefix
  name: 'ls', // name variable Vue.[ls] or this.[$ls],
  storage: 'local' // storage name session, local, memory
})
Vue.component('v-chart', ECharts)
Vue.use(VueAxios, router)
Vue.prototype.$message = message
Vue.prototype.$base = base()
Object.assign(Vue.prototype, {
  $get
})
Object.assign(Vue.prototype, {
  $post
})
message.config({
  maxCount: 1
})
rem()
process.env.NODE_ENV === 'production' && (console.log = () => {})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
